package db

import org.hibernate.Session

/**
 * manages operation with users in front of the database.
 * enables to save, update and delete a user
 */
class UserManager(session: Session) {
  if (session == null) {
    throw new RuntimeException("Invalid session object")
  }

  def saveUser(user: User) {
    session.save(user)
  }

  def updateUser(user: User) {
    session.update(user)
  }

  def deleteUser(user: User) {
    session.delete(user)
  }

}